import java.util.List;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode ret = binaryTree.createTree();
        System.out.println("===");
        System.out.println("前序遍历");
        binaryTree.preOrder(binaryTree.createTree());
        System.out.println();
        System.out.println("中序遍历");
        binaryTree.inOrder(binaryTree.createTree());
        System.out.println();
        System.out.println("后序遍历");
        binaryTree.postOrder(binaryTree.createTree());
        System.out.println();
        System.out.println("=================================");
        List<BinaryTree.TreeNode> list =binaryTree.preOrder2(ret);
        for(BinaryTree.TreeNode tree:list){
            System.out.print(tree.val+" ");
        }
        System.out.println();
        System.out.println("=================================");
        List<BinaryTree.TreeNode> list2 =binaryTree.inOrder2(ret);
        for(BinaryTree.TreeNode tree:list2){
            System.out.print(tree.val+" ");
        }
        System.out.println();
        System.out.println("=================================");
        List<BinaryTree.TreeNode> list3 =binaryTree.postOrder2(ret);
        for(BinaryTree.TreeNode tree:list3){
            System.out.print(tree.val+" ");
        }
        System.out.println();

    }
}
